![]() |
PATH![]() |
![]() ![]() |
AppleScript's support for dates is based on the same operating system utilities other Macintosh applications use. Mac OS date and time utilities have correctly handled issues related to the year 2000 since the introduction of the Macintosh. The original date and time utilities, introduced with the Macintosh 128K in 1984, use a 32-bit value to store seconds, starting at 12:00:00 a.m., January 1, 1904 and extending to 6:28:15 a.m. on February 6, 2040.
More recent date and time utilities use a 64-bit signed value that can represent dates from 30081 B.C. to 29940 A.D. However, AppleScript currently will not handle dates before 1/1/1000 or after 12/31/9999. For more information on Mac OS date and time utilities, see Inside Macintosh: Operating System Utilities. available at the Apple Developer website:
Figure 6-1 Two-digit dates at century boundaries
Two-digit dates near the year 2000, or any century boundary, may still represent a problem if your script accepts two-digit dates as text from applications or users. Whenever your script calls on AppleScript to convert a two-digit date to a Date value, AppleScript converts the text representation to a full date for internal storage, following the rules illustrated in Figure 6-1 and summarized here:
So a script that uses nearby dates, such as for office scheduling or other near-term planning, can use two-digit dates with some degree of safety. However, a script that does long-term date calculations, such as for genealogy or mortgages, should require four-digit dates.